/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.mes.action.produce;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.mes.mapper.produce.DetailsPlanMapper;
public class DetailsPlanAction extends BaseAction
{
    @Autowired(required=false)
	private DetailsPlanMapper mapper;
    /**
    计划详情
    */
    
    public Map detailsPlan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_plan=mapper.t_plan(params);
        SQLMap t_plan_emt=t_plan.getExistfirst();
        result.put("t_plan", t_plan_emt);
        
        return result;
    }
    /**
    计划修改
    */
    
    public Map productionPlanUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_plan=mapper.s_plan(params);
        SQLMap s_plan_emt=s_plan.getExistfirst();
        result.put("s_plan", s_plan_emt);
        
        return result;
    }
    /**
    物料清单
    */
    
    public Map materialList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_list=mapper.s_list(params);
        result.put("s_list", s_list);
        
        return result;
    }
    /**
    物料明细
    */
    
    public Map materiaDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_list=mapper.t_list(params);
        SQLMap t_list_emt=t_list.getExistfirst();
        result.put("t_list", t_list_emt);
        
        return result;
    }
    /**
    采购清单
    */
    
    public Map purchaseList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_plan=mapper.t_plan(params);
        SQLMap t_plan_emt=t_plan.getExistfirst();
        result.put("t_plan", t_plan_emt);
        
        
        SQLList<SQLMap> s_list=mapper.s_list(params);
        result.put("s_list", s_list);
        
        return result;
    }
    /**
    查看采购状态
    */
    
    public Map viovPurchase() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_list=mapper.s_list(params);
        result.put("s_list", s_list);
        
        return result;
    }
    /**
    计划修改修改
    */
    
    public Map productionPlanUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.productionPlanUpSubmit(params);
        
        return result;
    }
    /**
    物料明细修改
    */
    
    public Map materiaDetSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_task = mapper.i_task(params);
        result.put("i_task", i_task);
        
        
        mapper.materiaDetSubmit(params);
        
        return result;
    }
    /**
    采购清单修改
    */
    
    public Map purchaseListSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        Object bug_begin_time =
        mapper.bug_begin_time(params);
        result.put("bug_begin_time", bug_begin_time);
        
        
        int i_procurement_pro = mapper.i_procurement_pro(params);
        result.put("i_procurement_pro", i_procurement_pro);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_procurement_plan(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.u_procurement_pro(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.u_purchase_list(params);
        }
        
        return result;
    }
}